﻿namespace SandScript.Models.Documentation
{
    using System.Collections.Generic;
    using System.Xml.Serialization;

    [XmlRoot("root")]
    public class Root : Signature
    {
        public Root()
        {
            this.AllowFallback = true;
        }

        [XmlElement("signature")]
        public List<Signature> Signatures { get; set; }

        [XmlElement("field")]
        public List<Field> Fields { get; set; }

        public Signature GetSignature()
        {
            if (this.Signatures != null && this.Signatures.Count > 0)
            {
                return this.Signatures[0];
            }

            return this;
        }
    }
}
